package com.huawei.classroom.student.h06;

public class Barrack extends Base{
	public Barrack(int x,int y) {
		super(100,0,0,x,y);
	}
	public Base traing(EnumObjectType trained) {
		if(trained==EnumObjectType.rifleSoldier) {
			return new RifleSoldier(this.x,this.y);
		}
		else if(trained==EnumObjectType.RPGSoldier) {
			return new RPGSoldier(this.x,this.y);
		}
		else if(trained==EnumObjectType.dog) {
			return new Dog(this.x,this.y);
		}
		else return null;
	}
}